package com.personal.portal.common.config;

import cn.hutool.core.date.DateUtil;
import com.mybatisflex.annotation.UpdateListener;
import com.personal.portal.common.entity.BaseEntity;

public class MybatisUpdateListener implements UpdateListener {
    @Override
    public void onUpdate(Object o) {
        if (o instanceof BaseEntity) {
            BaseEntity baseEntity = (BaseEntity) o;
            baseEntity.setUpdateBy("zhanghui");
            baseEntity.setUpdateTime(DateUtil.now());
        }
    }
}
